home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / cvs-1.8 / cvs-1 / cvs-1.8.1 / configure.in < prev    next >
Encoding:
Text File  |  1996-05-06  |  5.2 KB  |  192 lines

  1. dnl configure.in for cvs
  2. dnl "$CVSid$"
  3. AC_INIT(src/cvs.h)
  4. AC_PREREQ(2.4)dnl Required Autoconf version.
  5. AC_CONFIG_HEADER(config.h src/options.h)
  6.  
  7. AC_PROG_CC
  8.  
  9. AC_AIX
  10. AC_MINIX
  11. AC_ISC_POSIX
  12. if test "$ISC" = yes; then
  13. CFLAGS="$CFLAGS -D_SYSV3"
  14. fi
  15.  
  16. AC_PREFIX_PROGRAM(cvs)
  17.  
  18. AC_C_CROSS
  19.  
  20. AC_C_CONST
  21. AC_C_CHAR_UNSIGNED
  22. AC_C_INLINE
  23.  
  24. AC_PROG_INSTALL
  25. AC_PROG_RANLIB
  26. AC_PROG_YACC
  27. AC_PROG_MAKE_SET
  28.  
  29. AC_PATH_PROG(perl_path, perl, no)
  30. AC_PATH_PROG(csh_path, csh, no)
  31.  
  32. AC_SYS_INTERPRETER
  33. if test X"$ac_cv_sys_interpreter" != X"yes" ; then
  34.   # silly trick to avoid problems in AC macros...
  35.   ac_msg='perl scripts using #! may not be invoked properly'
  36.   AC_MSG_WARN($ac_msg)
  37. fi
  38.  
  39. AC_HEADER_STDC
  40. AC_CHECK_HEADERS(errno.h unistd.h string.h memory.h utime.h fcntl.h ndbm.h \
  41.                  sys/param.h sys/select.h sys/time.h sys/timeb.h \
  42.                  io.h direct.h sys/bsdtypes.h sys/resource.h)
  43. AC_HEADER_SYS_WAIT
  44. AC_HEADER_STAT
  45. AC_HEADER_TIME
  46. AC_HEADER_DIRENT
  47. AC_TYPE_SIGNAL
  48. AC_TYPE_UID_T
  49. AC_TYPE_MODE_T
  50. AC_TYPE_SIZE_T
  51. AC_TYPE_PID_T
  52. AC_REPLACE_FUNCS(getwd mkdir rename strdup strstr dup2 strerror valloc waitpid memmove vasprintf strtoul)
  53. AC_CHECK_FUNCS(fchmod fsync ftime mkfifo putenv setvbuf vfork vprintf ftruncate timezone getpagesize initgroups fchdir sigaction sigprocmask sigvec sigsetmask sigblock)
  54. AC_CHECK_FUNC(re_exec, :, LIBOBJS="$LIBOBJS regex.o")
  55. AC_FUNC_UTIME_NULL
  56. AC_SYS_LONG_FILE_NAMES
  57.  
  58. AC_MSG_CHECKING([for working fnmatch function])
  59. AC_CACHE_VAL(ccvs_cv_sys_working_fnmatch,
  60. [AC_TRY_RUN([
  61. #include <fnmatch.h>
  62. int
  63. main ()
  64. {
  65.   exit ((fnmatch ("a", "a", FNM_PATHNAME) == 0
  66.      && fnmatch ("a", "b", FNM_PATHNAME) == FNM_NOMATCH)
  67.     ? 0 : 1);
  68. }],
  69. ccvs_cv_sys_working_fnmatch=yes,
  70. ccvs_cv_sys_working_fnmatch=no,
  71. ccvs_cv_sys_working_fnmatch=no)])
  72. if test $ccvs_cv_sys_working_fnmatch = no; then
  73.   LIBOBJS="$LIBOBJS fnmatch.o"
  74. fi
  75. AC_MSG_RESULT($ccvs_cv_sys_working_fnmatch)
  76.  
  77. dnl
  78. dnl set $(KRB4) from --with-krb4=value -- WITH_KRB4
  79. dnl
  80. KRB4=/usr/kerberos
  81. define(WITH_KRB4,[
  82. AC_ARG_WITH([krb4],
  83.   [  --with-krb4=value       set default \$(KRB4) from value],
  84.   [KRB4=$withval],
  85. )dnl
  86. echo "default place for krb4 is $KRB4"
  87. AC_SUBST(KRB4)])dnl
  88. WITH_KRB4
  89.  
  90. AC_CHECK_SIZEOF(long)
  91. AC_CHECK_SIZEOF(int)
  92.  
  93. krb_h=
  94. AC_MSG_CHECKING([for krb.h])
  95. AC_TRY_LINK([#include <krb.h>],[int i;],
  96.   [krb_h=yes krb_incdir=],
  97.   [if test "$cross_compiling" != yes && test -r $KRB4/include/krb.h; then
  98.      hold_cflags=$CFLAGS
  99.      CFLAGS="$CFLAGS -I$KRB4/include"
  100.      AC_TRY_LINK([#include <krb.h>],[int i;],
  101.        [krb_h=yes krb_incdir=$KRB4/include])
  102.      CFLAGS=$hold_cflags
  103.    fi])
  104. if test -z "$krb_h"; then
  105.   AC_TRY_LINK([#include <krb.h>],[int i;],
  106.     [krb_h=yes krb_incdir=],
  107.     [if test "$cross_compiling" != yes && test -r $KRB4/include/kerberosIV/krb.h; then
  108.        hold_cflags=$CFLAGS
  109.        CFLAGS="$CFLAGS -I$KRB4/include/kerberosIV"
  110.        AC_TRY_LINK([#include <krb.h>],[int i;],
  111.      [krb_h=yes krb_incdir=$KRB4/include/kerberosIV])
  112.        CFLAGS=$hold_cflags
  113.      fi])
  114. fi
  115. AC_MSG_RESULT($krb_h)
  116.  
  117. if test -n "$krb_h"; then
  118.   krb_lib=
  119.   AC_CHECK_LIB(krb,printf,[krb_lib=yes krb_libdir=],
  120.     [if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
  121.        krb_lib=yes krb_libdir=$KRB4/lib
  122.      fi])
  123.   if test -n "$krb_lib"; then
  124.     AC_DEFINE(HAVE_KERBEROS)
  125.     test -n "${krb_libdir}" && LIBS="${LIBS} -L${krb_libdir}"
  126.     LIBS="${LIBS} -lkrb"
  127.     AC_CHECK_LIB(des,printf,[LIBS="${LIBS} -ldes"])
  128.     if test -n "$krb_incdir"; then
  129.       includeopt="${includeopt} -I$krb_incdir"
  130.       AC_SUBST(includeopt)
  131.     fi
  132.   fi
  133. fi
  134. AC_CHECK_FUNCS(krb_get_err_text)
  135. # If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
  136. # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
  137. # libsocket.so which has a bad implementation of gethostbyname (it
  138. # only looks in /etc/hosts), so we only look for -lsocket if we need
  139. # it.
  140. unset ac_cv_func_connect
  141. AC_CHECK_FUNC(connect, :, 
  142. [case "$LIBS" in
  143. *-lnsl*) ;;
  144. *) AC_CHECK_LIB(nsl_s, printf) ;;
  145. esac
  146. case "$LIBS" in
  147. *-lnsl*) ;;
  148. *) AC_CHECK_LIB(nsl, printf) ;;
  149. esac
  150. case "$LIBS" in
  151. *-lsocket*) ;;
  152. *) AC_CHECK_LIB(socket, connect) ;;
  153. esac
  154. case "$LIBS" in
  155. *-linet*) ;;
  156. *) AC_CHECK_LIB(inet, connect) ;;
  157. esac
  158. unset ac_cv_func_connect
  159. AC_CHECK_FUNCS(connect)])
  160.  
  161. AC_CHECK_FUNC(gethostname, :, LIBOBJS="$LIBOBJS hostname.o")
  162.  
  163. # If we have connect(), we want the full client & server arrangement.
  164. if test "$ac_cv_func_connect" = yes; then
  165. AC_DEFINE(CLIENT_SUPPORT)
  166. AC_DEFINE(SERVER_SUPPORT)
  167. # Define AUTH_SERVER_SUPPORT only if we could locate the crypt() function
  168. unset ac_cv_func_crypt
  169. AC_CHECK_FUNC(crypt, :,
  170. [case "$LIBS" in
  171. *-lcrypt*) ;;
  172. *) AC_CHECK_LIB(crypt, crypt) ;;
  173. esac
  174. unset ac_cv_func_crypt
  175. AC_CHECK_FUNCS(crypt)])
  176.   if test "$ac_cv_func_crypt" = yes; then
  177.   AC_DEFINE(AUTH_SERVER_SUPPORT)
  178.   fi
  179. fi
  180.  
  181. test -f src/options.h && (
  182.   AC_MSG_WARN(saving ./src/options.h in ./src/options.h-SAVED)
  183.   AC_MSG_WARN(You may wish to check that local options have not been lost.)
  184.   AC_MSG_WARN(Do not re-run ./configure or ./config.status until you have....)
  185.   cp ./src/options.h ./src/options.h-SAVED
  186. )
  187.  
  188. AC_OUTPUT(Makefile lib/Makefile src/Makefile doc/Makefile \
  189.       man/Makefile tools/Makefile tools/pcl-cvs/Makefile \
  190.       contrib/Makefile contrib/elib/Makefile \
  191.       windows-NT/Makefile os2/Makefile macintosh/Makefile stamp-h)
  192.